package com.demo.project_template.util;

import java.security.SecureRandom;
import java.util.Calendar;
import java.util.Date;

/**
 * @Classname name = CommonUtil
 * @Description TODO
 * @Version 1.0.0
 * @Date 2023/6/19 15:43
 * @Created by ${Mr.Yao}
 */
public class CommonUtil {

    /**
     * 创建订单号
     * @return 订单号
     */
    public static String creatOrder() {
        return new SnowflakeIdWorkerUtil(1, 3).nextId() + "";
    }

    /**
     * 创建验证码
     *
     * @return 验证码
     */
    public static String creatCode() {
        SecureRandom random = new SecureRandom();
        int i = random.nextInt(899999) + 100000;
        return i + "";
    }
}
